$(function() {
	$("#chooseSongImage").click(function() {
		$("#songHead").toggle(1);
		$("#modelImage").toggle(1);
		$("#modelImage").css("width", "500");
	});

	findSpecial(1, 1);
});

function showfilter(dv) {
	$("#" + dv).fadeTo(100, 1);
}
function hidefilter(dv) {
	$("#" + dv).fadeTo(100, 0.5);
}

function save_img(index) {
	$("#modelImage").css("display", "block");
	$("#songHeadUrl").val(index);
	$("#songHead").toggle(1);
	var modelImage = document.getElementById("modelImage");
	modelImage.src = "image/song/" + index + ".jpg";
}

/**
 * 加载专辑
 */
function findSpecial(page, flag) {
	$.post(path + "/special/findSpecial.do",
		{"page" : page - 1,"flag" : flag,"specialnum":14},
		function(result) {
			if (result.success) {
				$("#refreshPage").empty();
				var list = result.data;
				var index=1;
				$(list).each(function() {
					var div = '<div class="pricing-span"><div class="widget-box pricing-box-small"><div class="widget-header header-color-red3"><h5 class="bigger lighter">NO.'
							+ index
							+ '</h5></div><div class="widget-body"><div class="widget-main no-padding"><ul class="list-unstyled list-striped pricing-table"><li class="control-label bolder blue">专辑名</li><li>'
							+ this.special_name
							+ '</li><li class="text-info">语种</li><li>'
							+ this.nation
							+ '</li><li class="text-success">演唱歌手</li><li><span class="label label-sm label-warning">'
							+ this.singer_name
							+ '</span></li></ul></div><div><a href="toadminAddSpecial.do&special_id='
							+ this.special_id
							+ '"class="btn btn-block btn-sm btn-success"> <span><i class="icon-zoom-in bigger-130"></i>查看专辑歌曲</span> </a></div></div></div></div>';
					$("#refreshPage").append(div);
					$("#refreshPage div:last").data("special", this);
					index++;
				});
			} else {
				alert(result.message);
			}
		});
}